package com.chinacoal.hr.levelimpl.service;


import com.chinacoal.hr.levelapi.entity.Organization;

import java.util.List;

public interface OrganizationService {

    public List<Organization> getAbsoluteOrganizations(String parentOrgId) throws Throwable;

    public List<Organization> getAbsoluteDepartments(String parentOrgId) throws Throwable;

    public Organization getOrganization(String orgId) throws Throwable;

    public Organization getOrganizationByCode(String orgCode) throws Throwable;

    /**
     * 根据orgid查找org对象，如果发现isleaf不匹配则找parent org，直到找到为止
     *
     * @param orgId  :
     * @param isLeaf :
     * @return : com.chinacoal.hr.levelimpl.entity.Organization
     * @author : YunTao.Li
     * @date : 2020/1/7 2020/1/7
     */
    public Organization getOrganizationRecursion(String orgId, String isLeaf) throws Throwable;

    /**
     * 查找人员所属的机构，如果发现此机构编码不是纯数字则为部门找上级机构
     *
     * @param orgId :
     * @return : com.chinacoal.hr.levelimpl.entity.Organization
     * @author : YunTao.Li
     * @date : 2020/7/9 2020/7/9
     */
    public Organization getOrganizationRecursion(String orgId) throws Throwable;

}
